<admintpl file="header" />
</head>
<body>
    <div class="wrap js-check-wrap">
        <ul class="nav nav-tabs">
     		<li><a href="{:U('Analysis/index')}">数据汇总</a></li>
     		<li><a href="{:U('Analysis/day')}">单日统计</a></li>
            <li><a href="{:U('Analysis/activity')}">活动统计</a></li>
            <li><a href="{:U('Analysis/materials')}">物料统计</a></li>
            <li><a href="{:U('Analysis/equipment')}">设备统计</a></li>
            <li class="active"><a href="{:U('Analysis/users')}">用户统计</a></li>
            <li><a href="{:U('Analysis/winning')}">中奖记录</a></li>
            <li><a href="{:U('Analysis/withdraw')}">提现记录</a></li>
            <li><a href="{:U('Analysis/logs')}">摇摇记录</a></li>
            <li><a href="{:U('Analysis/urls')}">链接记录</a></li>
        </ul>
        <form class="well form-search js-ajax-form" method="post" action="{:U('Analysis/users')}">
        	用户ID:
            <input type="text" name="keyword" value="{:I('param.keyword')}" autocomplete="off" >

            时间类型：
            <select name="btime" style="width: 150px;">
                <foreach name="btime" item="vo">
                    <option <if condition="(I('param.btime') eq $vo['id'])" >selected</if> value="{$vo.id}">{$vo.name}</option>
                </foreach>
            </select>
            <input type="text" name="start_time" style="width: 80px;" class="js-date" value="{:I('param.start_time')}" autocomplete="off"> ~
            <input type="text" name="end_time" style="width: 80px;" class="js-date" value="{:I('param.end_time')}" autocomplete="off">
            <input type="submit" class="btn btn-primary" value="搜索" />
            <if condition="$count" >共查询到 {$count} 条数据</if>
        	<button class="btn btn-primary js-ajax-submit" type="submit" data-action="{:U('Analysis/outuserscsv')}">查询导出</button>

        </form>
   <if condition="I('param.time')" >{:I('param.time')}<else />昨日</if>汇总数据：
            <table class="table table-hover table-bordered">
                <thead>
                    <tr>
                        <th>参与人数</th>
                        <th>新用户数</th>
                        <th>新用户占比</th>
                        <th>老用户数</th>
                        <th>老用户占比</th>
                        <th>中奖次数</th>
                        <th>人均中奖次</th>
                        <th>红包次数</th>
                        <th>红包金额(元)</th>
                        <th>人均红包(元)</th>
                        <th>卡券</th>
                        <th>实物</th>
                        <th>摇次数</th>
                        <th>人均摇次</th>
                    </tr>
                </thead>
                <foreach name="tsum" item="vo">
                    <tr>
                        <td>{$vo.people}</td>
                        <td>{$vo.news}</td>
                        <td>{$vo['news']/$vo['people']*100|substr=0,5}%</td>
                        <td>{$vo.olds}</td>
                        <td>{$vo['olds']/$vo['people']*100|substr=0,5}%</td>
                        <td>{$vo.winning}</td>
                        <td>{$vo['winning']/$vo['people']|substr=0,5}</td>
                        <td>{$vo.reds}</td>
                        <td>{$vo[moneys]/100}</td>
                        <td>{$vo['moneys']/$vo['people']/100|substr=0,5}</td>
                        <td>{$vo.cards}</td>
                		<td>{$vo.reals}</td>
                        <td>{$vo.shakes}</td>
                        <td>{$vo['shakes']/$vo['people']|substr=0,5}</td>
                    </tr>
                </foreach>
            </table><br>
   <if condition="I('param.time')" >{:I('param.time')}<else />每日</if>汇总数据：
            <table class="table table-hover table-bordered">
                <thead>
                    <tr>
                    	<th>用户ID</th>
                    	<th>日期</th>
                    	<th>用户昵称</th>
                        <th>创建时间</th>
                        <th>最后登录</th>
                        <th>中奖次</th>
                        <th>红包次</th>
                        <th>红包金额(元)</th>
                        <th>卡券次</th>
                        <th>物料次</th>
                        <th>摇次</th>
                    </tr>
                </thead>
                <foreach name="analysis" item="vo">
                    <tr>
                        <td>{$vo.openid}</td>
                        <td>{$vo.datetime}</td>
                        <td>{$vo.nickname}</td>
                        <td>{$vo.registered}</td>
                        <td>{$vo.enter}</td>
                        <td>{$vo.winning}</td>
                        <td>{$vo.reds}</td>
                        <td>{$vo[moneys]/100}</td>
                        <td>{$vo.cards}</td>
                        <td>{$vo.reals}</td>
                        <td>{$vo.shakes}</td>
                    </tr>
                </foreach>
                <thead>
                    <tr>
                    	<th>用户ID</th>
                    	<th>日期</th>
                    	<th>用户昵称</th>
                        <th>创建时间</th>
                        <th>最后登录</th>
                        <th>中奖次</th>
                        <th>红包次</th>
                        <th>红包金额(元)</th>
                        <th>卡券次</th>
                        <th>物料次</th>
                        <th>摇次</th>
                    </tr>
                </thead>
            </table>
            <div class="pagination">{$page}</div>
    </div>
    <script src="__PUBLIC__/js/common.js"></script>
</body>
</html>